/**
 * Created by win7 on 2017/3/15.
 */

import React , {Component}from 'react';
import { Modal, Button } from 'antd';
import InputBox from '../../common/InputBox.js'
import Confirm from '../../common/Confirm'
import Select from '../../common/Select'

/*业务平台>人员管理>编辑部门*/

export default class ForbidComapny extends React.Component {
    constructor(props){
        super(props);
        this.state = {
            visible: false,
            companyName:'',
            companyNumber:''
        }
        this.Style={};
    }

    componentWillMount() {
        this.setState({
            setdefault:this.props.setdefault
        });
        this.setState({
            partid:this.props.partid
        })
        this.Style.addpersonview={
            textAlign:"center",
            display:"block",
            border:"3px solid green"
        }
        this.Style.addpersonview.width = 400;
        this.Style.addpersonview.height = 200;
        this.Style.addpersonview.fontSize = 30;

        this.Style.addpersonview={
            width:"634px",
            height:"44px",
            paddingLeft:"18px",
            lineHeight:"44px",
            display:"block",
            background:"#f2f2f2",
            marginBottom:49
        }
    }

    componentDidMount(){
    }

    state = { visible: false }
    showModal = () => {
        this.setState({
            visible: true,
        });

    }
    handleOk = (e) => {
        this.setState({
            visible: false,
        });
    }
    handleCancel = (e) => {
        this.setState({
            visible: false,
        });
    }

    forbidCompany(){
        let text = this.refs.muchforbiddescription.state.text
        if(text==''){
            this.refs.muchforbiddescription.setState({
                text:'原因必填'
            })
        }
        this.props.onmuchforbidData(text)
    }

    setname(name,description){
        this.refs.partname.setState({
            text: name
        });
        this.refs.partdescription.setState({
            text: description ||''
        });
    }

    render(){
        return (
            <div>
                <Modal visible={this.state.visible} onOk={this.handleOk} onCancel={this.handleCancel} style={{width:"634px",height:"240px",display:"block"}} title={"批量禁用"}>
                    <div style={{position:"absolute",left:66,top:-30}}><span>企业数量：</span><span>{this.state.companyNumber}</span></div>
                    <InputBox multiline defaultvalute="内容最多不得超过200个字。" titletext="" space="12px" style={{width:338,height:115,borderColor:"#d7d7d7",color:"#999",marginTop:50,paddingRight:123,paddingLeft:100}} ref={'muchforbiddescription'}/>
                    <Confirm tcontext="禁用" style={{width:266,height:42,display:"block",color:"#fff",fontSize:"16px",marginTop:60,marginLeft:158}} touch={this.forbidCompany.bind(this)}/>
                    <span style={{position:"absolute",left:64,top:0,width:84,height:18}}>*禁用原因</span>
                </Modal>
            </div>
        )
    }
}
